<%--
  Created by IntelliJ IDEA.
  User: chenli
  Date: 2017/3/22
  Time: 10:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
    <link rel="stylesheet" href="<%=basePath %>/css/list.css">
    <link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />


    <script src="<%=basePath %>js/jquery.min.js"></script>
    <link rel="stylesheet" href="<%=basePath %>lib/icheck/icheck.css">
    <script src="<%=basePath %>lib/My97DatePicker/WdatePicker.js"></script>
    <script src="<%=basePath %>lib/icheck/jquery.icheck.min.js"></script>
    <script src="<%=basePath %>lib/bootstrap-modal/2.2.4/bootstrap-modalmanager.js"></script>
    <script src="<%=basePath %>lib/bootstrap-modal/2.2.4/bootstrap-modal.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=basePath %>/css/simditor.css" />
    <script type="text/javascript" src="<%=basePath %>/js/module.js"></script>
    <script type="text/javascript" src="<%=basePath %>/js/hotkeys.js"></script>
    <script type="text/javascript" src="<%=basePath %>/js/uploader.js"></script>
    <script type="text/javascript" src="<%=basePath %>/js/simditor.js"></script>
    <script type="text/javascript" src="<%=basePath %>js/H-ui.js"></script>
    <script type="text/javascript" src="<%=basePath %>js/laydate/laydate.js"></script>

    <script type="text/javascript">
    </script>
</head>
<body>
<div class="connect_wrap">
    <h3 style= "text-align: center;">广告维护</h3>
    <div class="row cl" style="max-width:88%;margin-left:8%;">
        <div class="labelText"></div>
        <form action="<%=basePath %>advertisement/saveOrUpdate" method="post"
              enctype="multipart/form-data" >
            <div class="col-sm-4"></div>
            <div class="col-sm-4">
                <div class="boxs">
                    <input type="hidden" name="id" value="${advertisement.id}">
                    <input type="text" class="inputBox" name="eventtitle" value="${advertisement.eventtitle}" placeholder="广告标题">
                    <input type="file" class="inputBox" placeholder="低分辨率图片上传" name="lowFile"
                           value="${advertisement.lowresolution}" onchange="lowImg1()" id="lowFile"/>
                    <br /><br /><img src="${advertisement.lowresolution}" id="lowImg" width="180" height="320"
                        <c:if test="${empty advertisement.lowresolution}">style="display: none;"</c:if> />
                    <input type="file" class="inputBox" placeholder="高分辨率图片上传" name="hightFile"
                           value="${advertisement.hightresolution}" onchange="highImg1()" id="highFile"/>
                    <br /><br /><img src="${advertisement.hightresolution}" id="highImg" width="180" height="320"
                                     <c:if test="${empty advertisement.hightresolution}">style="display: none;"</c:if> />
                    <input type="text" class="inputBox" name="eventurl" value="${advertisement.eventurl}" placeholder="广告图片点击链接">
                    <input name="date" class="inputBox" placeholder="有效期时间范围" type="text" id="date" readonly="readonly"
                           value="<c:if test="${not empty advertisement.startdate}"><fmt:formatDate value="${advertisement.startdate}" pattern="yyyy-MM-dd HH:mm:ss" /> - <fmt:formatDate value="${advertisement.enddate}" pattern="yyyy-MM-dd HH:mm:ss" /></c:if>">
                    <select name="disable" class="selectBox"  >
                        <option value="">广告状态</option>
                        <option value="0" ${advertisement.disable == 0 ? 'selected="seelcted"' : '' }>启用</option>
                        <option value="1" ${advertisement.disable == 1 ? 'selected="seelcted"' : '' }>停用</option>
                    </select>
                    <input type="submit"  class="true" value="提交">
                    <input type="button"  class="false" value="取消" onclick="window.history.go(-1)">

                </div>
            </div>
        </form>
    </div>
</div>
</body>

<script src="<%=basePath %>/js/formsJS.js"></script>
<script>
    function lowImg1() {
        var url = window.URL.createObjectURL($("#lowFile")[0].files[0]);
        $("#lowImg").attr('src', url);
        $("#lowImg").css("display", "");
    };
    function highImg1() {
        var url = window.URL.createObjectURL($("#highFile")[0].files[0]);
        $("#highImg").attr('src', url);
        $("#highImg").css("display", "");
    };
    $(function(){
        laydate.render({
            elem: '#date'
            ,type: 'datetime'
            ,range: true
        });

        editor = new Simditor({
            textarea: $('textarea[name="content"]')
        });


    });

</script>

</html>

